// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import http from "./util/http"
import qs from 'qs'
import store from "./util/store";
import elementui from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import  vuex from 'vuex'
Vue.use(vuex)
Vue.use(elementui)
Vue.config.productionTip = false
Vue.prototype.$http=http
Vue.prototype.$qs=qs
Vue.prototype.$store=store
/* eslint-disable no-new */
// router.beforeEach((to, from, next) => {
//   let loginUser = sessionStorage.getItem('loginUser')
//   if (to.name == 'Login' || loginUser != null) {
//     // 去登录或者是已经登录
//     next()
//   } else {
//     // 未登录
//     next('/')
//   }
// })

new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
